package com.freecloud.javabasics.thread.condition;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author: maomao
 * @Date: 2020-02-22 13:13
 */
public class ConditionDemo {

    public static void main(String[] args) {
        Lock lock = new ReentrantLock();//重入锁

        Condition condition = lock.newCondition();

        new Thread(new ConditionWait(lock,condition)).start();

        new Thread(new ConditionNotify(lock,condition)).start();
    }
}
